package com.fenghui.doubantop.service.impl;

import com.fenghui.doubantop.service.IParseService;
import com.fenghui.doubantop.utils.ParseUtil;

import java.util.ArrayList;
import java.util.List;

public class ParseServiceImpl implements IParseService {

    /**
     * 解析网页数据
     *
     * @param baseUrl
     * @return
     */
    @Override
    public List crawler(String baseUrl,ParseUtil parseUtil) {
        List lists = new ArrayList<>();
        for (int i = 0; i < 226; i += 25) {
            String url = baseUrl + i;
            lists.addAll(parseUtil.parse(url));
        }
        return lists;
    }


}
